<?php 
$student_name = $_SESSION['student_name'];
$birthday = $_SESSION['birthday'];
$edu_system = $_SESSION['edu_system'];
$branch = $_SESSION['branch'];
$course = $_SESSION['course'];
$pages = $_SESSION['pages'];
?>
<div class="space"></div>

<div class="box">
	<div class="box-header">Bảng Điểm Của Sinh Viên #<?php echo $student_id; ?></div>
	<div class="box-content">
	<?php if(isset($scores)): ?>
	<table class="tabular-data image">
		<thead>
			<tr>
				<th scope="col" id="code">Mã Môn Học</th>
				<th scope="col" id="name">Tên Môn Học</th>
				<th scope="col" id="term">Học Kỳ</th>
				<th scope="col" id="score">Điểm<br  />Kiểm Tra</th>
				<th scope="col" id="score">Điểm<br  />Thi Lần 1</th>
				<th scope="col" id="score">Điểm<br  />Thi Lần 2</th>
				<th scope="col" id="task">Thao Tác</th>
			</tr>
		</thead>
		
		<tfoot>
			<tr>
				<td colspan="7">
					<div id="navlist" >
						<ul>
							<?php for($i = 0; $i < $pages; ++$i) { ?>
							<li><a href=".?add_score&index=<?php echo $i; ?>"><?php echo $i + 1; ?></a></li>
							<?php }?>
						</ul>			
					</div>
				</td>
			</tr>
		</tfoot>
		
		<tbody>
			<?php foreach($scores as $score): ?>
			<tr>		
				<td><?php echo $score['subject_id']?></td>
				<td><?php echo $score['subject_name']?></td>
				<td><?php echo $score['term']?></td>
				<td><?php echo $score['test_score']?></td>	
				<td><?php echo $score['exam_score1']?></td>
				<td><?php echo $score['exam_score2']?></td>
				<td>
					<form method="post" action="">
						<input type="hidden" name="student_id" value="<?php echo $student_id; ?>"/>
						<input type="hidden" name="subject_id" value="<?php echo $score['subject_id']; ?>"/>
						<input type="hidden" name="term" value="<?php echo $score['term']; ?>" />
						<input class="button edit" type="submit" onclick="savPos( this.form )" name="action" value="Sửa điểm" />
						<input class="button delete" type="submit" onclick="savPos( this.form )" name="action" value="Xóa điểm" />
					</form>
				</td>	
			</tr>
			<?php endforeach; ?>	
		</tbody>
	</table>
	<?php endif;?>
	</div><!-- close box content -->
</div><!-- close box -->

<div class="space"></div>